﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GeoSketch2.Core
{
    public partial class TBBDistanceLine : BaseToolbarButton
    {
        #region Constructor
        /// <summary>
        /// The toolbar button for the distance line tool for the rectification form
        /// </summary>
        public TBBDistanceLine()
        {
            InitializeComponent();
            ToolTipText = "Distance Line";
        } 
        #endregion

        #region Events
        /// <summary>
        /// The event on the mouse click on the button
        /// </summary>
        protected override void OnMouseClick(object sender, MouseEventArgs e)
        {
            DisplayBox.Viewport.CurrentLayer = DisplayBox.Viewport.Layers.Find(delegate(Layer l) { return l.Name == "DistancesLines"; });
           
            base.OnMouseClick(sender, e);
        }
        #endregion
        #region Properties
        /// <summary>
        /// Gets the tool assigned to the button
        /// </summary>
        protected override BaseTool Tool
        {
            get
            {
                return new TDistanceLine(DisplayBox.Viewport);
            }
        }
        #endregion
    }
}